Skip to content

Handle non-resumable pending user input#2766

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
mjc:pending-user-input-fix
Jun 12, 2026
Merged

Handle non-resumable pending user input#2766
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
mjc:pending-user-input-fix

Conversation

@mjc

@mjc mjc commented May 19, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • Treat Codex's non-resumable pending user-input callback error as a stale pending request.
  • Clear stale pending user-input state in both server projections and web session derivation.
  • Cover the Codex error wording in server and web tests.

Why

Submitting answers to a stale/non-resumable pending user-input request could look like it did something, then leave the user stuck on the same prompt. This keeps the fix small and consistent with the existing string-matching recovery shape already used for stale pending provider callbacks.

This is also one instance of a broader state-modeling problem. I want to make these invalid states unrepresentable; there are about a dozen bugs like this or more that I run into regularly, and they make the app pretty unusable. I would be down to do the sweeping refactor required to address state drift between the UI and the server, and between different parts of the UI itself, instead of relying on projected stale state recovery.

Testing:

  • bun fmt
  • bun lint (existing warnings only)
  • bun typecheck
  • bun run test

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (no UI changes)
  • I included a video for animation/interaction changes (no animation/interaction changes)

Note

Low Risk
Small, localized string-matching changes to pending user-input recovery with added tests; no auth or API contract changes.

Overview
Codex can return unknown pending user input errors with wording that did not match the existing user-input hyphenated checks, so stale prompts could stay open in projections and the web UI after a failed respond.

The PR extends the same stale-recovery string matching in server (ProviderCommandReactor, ProjectionPipeline) and web (session-logic) to also treat unknown pending user input request and unknown pending codex user input request (case-insensitive) as non-resumable failures that clear pending state. Tests cover projection pending_user_input_count dropping to zero after a Codex-style failure activity and align web/reactor expectations with the raw adapter error text.

Reviewed by Cursor Bugbot for commit 0bdf87c. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Handle non-resumable pending user input by recognizing additional provider error messages

Extends error detection in three places to treat 'unknown pending user input request' and 'unknown pending codex user input request' (case-insensitive) as signals that a pending user-input request cannot be resumed:

Macroscope summarized 0bdf87c.

Copilot AI review requested due to automatic review settings May 19, 2026 23:49
@coderabbitai

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 60e929c7-ab8c-41fe-93d5-36320bf6246a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels May 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR expands “stale/unknown pending user input request” detection to handle additional error message variants (including the Codex-specific wording) and updates tests accordingly.

Changes:

  • Added new substring matches for “unknown pending user input request” (no hyphen) and “unknown pending codex user input request”.
  • Updated web and server logic to recognize the new error detail formats.
  • Updated tests to use the new Codex error detail string.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/web/src/session-logic.ts Extends stale/unknown pending request detection to include Codex wording variants.
apps/web/src/session-logic.test.ts Updates test fixture detail string to match new provider error format.
apps/server/src/orchestration/Layers/ProviderCommandReactor.ts Broadens matching for unknown pending user-input errors (including Codex variant) with lowercasing.
apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts Updates test to assert behavior using the new Codex error detail string.
apps/server/src/orchestration/Layers/ProjectionPipeline.ts Extends pending user input count logic to include new “unknown pending …” variants.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/server/src/orchestration/Layers/ProjectionPipeline.ts
Comment on lines +145 to +157
const detail = error.detail.toLowerCase();
return (
detail.includes("unknown pending user-input request") ||
detail.includes("unknown pending user input request") ||
detail.includes("unknown pending codex user input request")
);
}
return Cause.pretty(cause).toLowerCase().includes("unknown pending user-input request");
const message = Cause.pretty(cause).toLowerCase();
return (
message.includes("unknown pending user-input request") ||
message.includes("unknown pending user input request") ||
message.includes("unknown pending codex user input request")
);

@mjc mjc May 20, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a helper feels like the wrong thing, these really should not be string matching so much... there's not enough use of types in this app and state drifts constantly as a result

@macroscopeapp

macroscopeapp Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Straightforward bug fix that adds additional error message patterns to detect non-resumable user input requests. The changes are mechanical string pattern additions with no new capabilities or behavioral changes beyond improved error detection. The review comment about code duplication is a style concern, not a correctness issue.

You can customize Macroscope's approvability policy. Learn more.

@mjc mjc force-pushed the pending-user-input-fix branch from 84c9167 to e724823 Compare May 20, 2026 00:05
@juliusmarminge juliusmarminge enabled auto-merge (squash) June 12, 2026 02:11
@juliusmarminge juliusmarminge merged commit ae39bac into pingdotgg:main Jun 12, 2026
14 checks passed
tarik02 added a commit to tarik02/t3code that referenced this pull request Jun 12, 2026
* Rework message metadata, timestamps, and tool work log rows (pingdotgg#3022)

Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* [codex] Sync app-server protocol, service tiers, and provider startup (pingdotgg#3036)

Co-authored-by: codex <codex@users.noreply.github.com>

* [codex] Reduce Git status polling churn (pingdotgg#3037)

Co-authored-by: codex <codex@users.noreply.github.com>

* Fix turn fold proejctions (pingdotgg#3041)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(git): disable external diff for patch output (pingdotgg#2553)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* [codex] Refine inline tool call timeline UI (pingdotgg#3052)

Co-authored-by: codex <codex@users.noreply.github.com>

* [codex] fix slow websocket shutdown (pingdotgg#2869)

Co-authored-by: Julius Marminge <julius@macmini.local>

* Handle non-resumable pending user input (pingdotgg#2766)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* fix: avoid sending composer during IME enter (pingdotgg#2817)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

---------

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Magnus Alexander Strømseng <magnus.stromseng@gmail.com>
Co-authored-by: Julius Marminge <julius@macmini.local>
Co-authored-by: Mika Cohen <mjc@kernel.org>
Co-authored-by: Huakun <huakun.shen@huakunshen.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@mjc mjc deleted the pending-user-input-fix branch June 12, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants